/**
 * introduce : router实例
 * author    : yhy
 * date      : 2018/07/02
 */
import Vue from 'vue'
import Router from 'vue-router'
import allRouter from '@/router/routerConfig.js'
Vue.use(Router)

let router = new Router({
  routes: [...allRouter],
  scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
})

// 全局前置钩子函数
router.beforeEach((to, from, next) => {
  next()
})
router.afterEach((to, from) => {})
export default router
